﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CSP.Web.UserControls
{
    public partial class HelpNavigation : System.Web.UI.UserControl
    {

        private string _selectedStyle = "current";
        private HomeHelpNavigationLink _selectedNavigationLink = HomeHelpNavigationLink.NoAppoint;

        /// <summary>
        /// 获取或设置选中的link
        /// </summary>
        public HomeHelpNavigationLink SelectedNavigationLink
        {
            get
            {
                return _selectedNavigationLink;
            }
            set
            {
                _selectedNavigationLink = value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AppointCurrentLink();
            }
        }

        /// <summary>
        /// 指定选中的链接
        /// </summary>
        private void AppointCurrentLink()
        {
            switch (_selectedNavigationLink)
            {
                case HomeHelpNavigationLink.Evaluate:
                    this.A_Evaluate.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpAfterService:
                    this.A_HelpAfterService.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpAuthoriz:
                    this.A_HelpAuthoriz.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpConfirm:
                    this.A_HelpConfirm.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpContact:
                    this.A_HelpContact.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpLevelInfo:
                    this.A_HelpLevelInfo.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpPublish:
                    this.A_HelpPublish.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpRule:
                    this.A_HelpRule.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpService:
                    this.A_HelpService.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpStrongth:
                    this.A_HelpStrongth.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpOrderFlow:
                    this.A_HelpOrderFlow.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpAbout:
                    this.A_HelpAbout.Attributes.Add("class", _selectedStyle);
                    break;
                case HomeHelpNavigationLink.HelpCredit:
                    this.A_HelpCredit.Attributes.Add("class", _selectedStyle);
                    break;
                default:
                    break;
            }
        }

        /// <summary>
        /// MyHomeLeftNavigationLink
        /// </summary>
        public enum HomeHelpNavigationLink
        {

            /// <summary>
            /// 未指定
            /// </summary>
            NoAppoint = 0,

            /// <summary>
            /// 如何评价
            /// </summary>
            Evaluate = 1,

            /// <summary>
            /// 退款维权投诉
            /// </summary>
            HelpAfterService = 2,

            /// <summary>
            /// 资质认证
            /// </summary>
            HelpAuthoriz = 3,

            /// <summary>
            /// 如何确认
            /// </summary>
            HelpConfirm = 4,

            /// <summary>
            /// 联系我们
            /// </summary>
            HelpContact = 5,

            /// <summary>
            /// 诚信保障服务
            /// </summary>
            HelpCredit = 6,

            /// <summary>
            /// 评价体系介绍
            /// </summary>
            HelpLevelInfo = 7,

            /// <summary>
            /// 如何发布课程
            /// </summary>
            HelpPublish = 8,

            /// <summary>
            /// 网站规则
            /// </summary>
            HelpRule = 9,

            /// <summary>
            /// 服务条款
            /// </summary>
            HelpService = 10,

            /// <summary>
            /// 入驻优势
            /// </summary>
            HelpStrongth = 11,

            /// <summary>
            /// 预约流程
            /// </summary>
            HelpOrderFlow = 12,


            /// <summary>
            /// 公司介绍
            /// </summary>
            HelpAbout = 13,
        }
    }
}